function debounce(func, delay) {
  let timer = null
  return () => {
    clearTimeout(timer)
    const args = [...arguments]
    const _this = this
    timer = setTimeout(() => {
      func.apply(_this, args)
    }, delay)  
  }
}
// 防抖函数